/**
 * @Title: index.js
 * @Description: index
 * @author: LoveCrossZhu
 * @date: 2020/7/7 11:38 PM
 * @version V1.0
 */
import * as React from 'react';
import {Button, View, Text} from 'react-native';
import {NavigationContainer} from '@react-navigation/native';
import {createStackNavigator} from '@react-navigation/stack';
import Classes from '@/pages/classes';
import Login from '@/pages/login';
import SubClasses from '@/pages/classes/sub-classes';
import ClassDetail from "../classes/detail";
import WifiList from "@/pages/wifi-config";
import SafeAreaView from 'react-native-safe-area-view';

const MainStack = createStackNavigator();
const RootStack = createStackNavigator();

function MainStackScreen() {
    return (
        <MainStack.Navigator headerMode="none">
            <MainStack.Screen name="Home" component={Classes} options={{headerShown: false}}/>
            <MainStack.Screen name="SubClasses" component={SubClasses}/>
            <MainStack.Screen name="ClassDetail" component={ClassDetail} options={{headerShown: false}}/>
        </MainStack.Navigator>
    );
}

function App() {
    return (
        <NavigationContainer>
            <RootStack.Navigator mode="modal" initialRouteName="Main">
                <RootStack.Screen
                    name="Main"
                    component={MainStackScreen}
                    options={{headerShown: false}}
                />
                {/*登录*/}
                <RootStack.Screen name="Login" component={Login} options={{headerShown: false}}/>
                {/*Wi-Fi配置*/}
                <RootStack.Screen
                    name="WifiConfig"
                    component={WifiList}
                    options={{headerShown: false}}/>
            </RootStack.Navigator>
        </NavigationContainer>
    );
}

export default App;
